const type = {
    CONNECT: 0,
    CLOSE: 1,
    MESSAGE: 2
}


class Packet {
    constructor(message) {
        this.message = message;
    }
}


exports.ConnectPacket = class ConnectPacket extends Packet {
    constructor(message) {
        super(message);
        this.type = type.CONNECT;
    }
}

exports.ClosePacket = class ClosePacket extends Packet {
    constructor(message) {
        super(message);
        this.type = type.CLOSE;
    }
}

exports.MessagePacket = class MessagePacket extends Packet {
    constructor(message, userOperateType) {
        super(message);
        this.userOperateType = userOperateType;
        this.type = type.MESSAGE;

    }
}

exports.type = type;
